package main

import (
	"fyne.io/fyne/v2"
	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/container"
	"fyne.io/fyne/v2/widget"
	themex "github.com/zhaocy/fyne-theme"
)

func main() {
	myApp := app.New()
	myApp.Settings().SetTheme(themex.Themex())
	myWin := myApp.NewWindow("storage")

	s := myApp.Storage()


	createBtn := widget.NewButton("创建", func() {
		uc, err := s.Create("test")
		if err != nil {
			fyne.LogError("create storage ", err)
		}

		if _, err := uc.Write([]byte("aaa")); err != nil {
			fyne.LogError("write err ", err)
		}
	})

	saveBtn := widget.NewButton("保存", func() {

	})
	myWin.SetContent(container.NewVBox(createBtn, saveBtn))
	myWin.Resize(fyne.NewSize(550, 450))
	myWin.ShowAndRun()
}
